This rule addresses the issue of incomplete assertions that can occur when using certain test frameworks. Incomplete assertions can lead to tests
that do not effectively verify anything. The rule enforces the use of complete assertions in specific cases, namely:
- Fluent Assertions: Should() is not followed by an assertion invocation.
string actual = "Using Fluent Assertions";
actual.Should(); // Noncompliant
- NFluent: Check.That() is not followed by an assertion invocation.
string actual = "Using NFluent";
Check.That(actual); // Noncompliant
- NSubstitute: Received() is not followed by an invocation.
command.Received(); // Noncompliant
In such cases, what is intended to be a test doesn’t actually verify anything.